package com.caocaog.market.finance.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.caocaog.market.finance.entity.MkBillChange;
import com.caocaog.market.finance.entity.MkBillLine;
import com.caocaog.market.finance.vo.SysCheckVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author liguang
 * @version 1.0.0
 * @Project jeecg-boot
 * @Package com.caocaog.market.finance.service
 * @ClassName MkBillHistoryService.java
 * @createTime 2021年12月03日 19:24:00
 * @Description TODO
 */
public interface MkBillLineService extends IService<MkBillLine> {

    /**
     * 分页查询
     */
    IPage<MkBillLine> findForPage(Page<MkBillLine> page, MkBillLine billLine);

    List<SysCheckVo> findSysCheckVoList();

    /**
     * 不分页
     */
    List<MkBillLine> findForPage(MkBillLine billLine);

    /**
     * 审核通过、只是状态的改变
     * 驳回  状态和原因的改变
     * */
    int withdrawCashApplication(MkBillLine billLine,Integer nextStatus);

    /**
     *提现申请
     */
    int applyForWithdrawCash(MkBillLine billLine,Integer nextStatus);

    /**
     *提现审核
     */
    boolean checkBillChange(MkBillChange billChange);


    /**
     * 批量通过或驳回
     * @param sysCheckVos sysCheckVosList集合
     * @param nextStatus 要改变的状态 现在只有审核通过可批量操作
     * @return 受影响行数
     */
    int batchWithdrawCashApplication(List<SysCheckVo> sysCheckVos, Integer nextStatus);

    int batchWithdrawCashApplications(List<MkBillLine> billLine, Integer nextStatus);

    Integer batchWithdrawById(List<String> idList);

    String transfer(String billLineId);

    /**
     * 根据id进行审核
     */
    int checkApplication(MkBillLine billLine);

    MkBillLine findById(String id);

    /**
     * 根据条件查询该条件下有多少条数据
     */
    int numByCondation(QueryWrapper<MkBillLine> qw);

    /**
     * 批量转账
     */
    boolean transferAll(Integer id);

}
